home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Forever 4
/
Atari Forever 4.zip
/
Atari Forever 4.iso
/
SERIE_DM
/
DM_154
/
DM_154.MSA
/
TRK_CONV.LST
< prev
next >
Wrap
File List
|
1986-02-06
|
5KB
|
169 lines
' ------- Tracker Converter ------- v1.0
' geschrieben von Fugu & Chris 4/90
' -----------------------------------------------------------------------------
'
' 4 Bytes für einen Eintrag = 2 Bytes Notenwert + 2 Bytes Attribut
'
' Songname: Bytes 1-20
' Anfang der Sampleliste: ab Byte 21 (450 Bytes)
' je 30 Bytes: 22 Name + 2 Länge? + 2 Volume + 4 Loop
' Länge der Patternliste: Byte 471
' Patternliste: ab Byte 473 (120 Bytes)
' Byte 593-600: 00
' Patterns: ab Byte 601 (je 1024 Bytes)
' -----------------------------------------------------------------------------
'
' 2 Bytes für einen Eintrag = 1 Byte Notenwert + 1 Byte Attribut
'
' "AN COOL!": Byte 1-8
' Byte 9-11: 00
' Anzahl Patterns: Byte 12
' Speed: Byte 13
' Byte 14: 00
' Patternliste: ab Byte 15 (128 Bytes)
' Länge der Patternliste: Byte 143
' Byte 144: 00
' Sampleliste: ab Byte 145 (128 Bytes)
' Patterns: ab Byte 273 (je 512 Bytes)
'
DEFLIST 0
maxlen=200000
DIM smp%(maxlen/4)
s_offs=LPEEK(ARRPTR(smp%()))+4
d_offs=s_offs+100000
DIM voice%(3),oldvoice%(3)
DIM t%(36)
@tab_init
'
REPEAT
CLS
PRINT AT(10,2);CHR$(27);"p Tracker Converter V1.0 ";CHR$(27);"q"
PRINT AT(24,4);"by fugu & chris"
PRINT AT(1,8);"<1> Amiga Soundtracker --> TCB Tracker"
PRINT AT(1,10);"<2> TCB Tracker --> Amiga Soundtracker"
PRINT AT(1,12);"<CR> Quit"
REPEAT
PRINT AT(10,20);SPC(30)
PRINT AT(10,20);
INPUT "--> your choice: ",w$
UNTIL (w$="1") OR (w$="2") OR (w$="")
PRINT CHR$(7);
IF w$="1"
@am_to_st
ELSE
IF w$="2"
@st_to_am
ENDIF
ENDIF
UNTIL w$=""
EDIT
'
PROCEDURE am_to_st
FILESELECT "\*.ami","",n$
IF n$<>""
BLOAD n$,s_offs
PRINT AT(10,23);"File: ";n$
' ---> Header erstellen
maxpat=0
FOR i=0 TO 127 !Anz. Patterns ermitteln
IF maxpat<PEEK(s_offs+472+i)
maxpat=PEEK(s_offs+472+i)
ENDIF
NEXT i
INC maxpat
a$="AN COOL!"+STRING$(3,CHR$(0))+CHR$(maxpat)+CHR$(5)+CHR$(0)
BMOVE VARPTR(a$),d_offs,14 ! eintragen...
BMOVE s_offs+472,d_offs+14,128 ! Patternliste
POKE d_offs+142,PEEK(s_offs+470) ! Länge der Patternliste
s$=SPACE$(8)
FOR i=0 TO 14
BMOVE s_offs+20+6+30*i,VARPTR(s$),8 ! Sampleliste
s$=UPPER$(s$)
BMOVE VARPTR(s$),d_offs+144+8*(i+1),8
NEXT i
' ---> Patterns
ARRAYFILL oldvoice%(),0
FOR i=0 TO maxpat-1
PRINT AT(5,16);"...only ";maxpat-i;" patterns to go..."
FOR z=0 TO 63
FOR s=0 TO 3
adr=s_offs+600+1024*i+16*z+4*s
s_note=DPEEK(adr)
voice%(s)=PEEK(adr+2) AND 240
IF voice%(s)=0
voice%(s)=oldvoice%(s)
ENDIF
oldvoice%(s)=voice%(s)
pos=-1
FOR j=0 TO 35
IF ABS(t%(j)-s_note)<2
pos=j
ENDIF
NEXT j
IF pos>=0
d_note=16*((pos DIV 12)+1)+pos MOD 12
adr=d_offs+272+512*i+8*z+2*s
POKE adr,d_note
POKE adr+1,voice%(s)
ENDIF
NEXT s
NEXT z
NEXT i
l=272+512*maxpat
FILESELECT "\*.sng","",n$
IF n$<>""
BSAVE n$,d_offs,l
ENDIF
ENDIF
RETURN
'
PROCEDURE st_to_am
FILESELECT "\*.sng","",n$
IF n$<>""
BLOAD n$,s_offs
PRINT AT(10,23);"File: ";n$
' ---> Header erstellen
s$="TESTNAME"
BMOVE VARPTR(s$),d_offs,8 ! Songname
maxpat=PEEK(s_offs+11) ! Anz. Patterns
POKE d_offs+470,PEEK(s_offs+142) ! Länge Patternliste
BMOVE s_offs+14,d_offs+472,120 ! Patternliste
FOR i=0 TO 14
BMOVE s_offs+144+8+8*i,d_offs+20+30*i,8 ! Sampleliste
NEXT i
' ---> Patterns
FOR i=0 TO maxpat-1
PRINT AT(5,16);"...only ";maxpat-i;" patterns to go..."
FOR z=0 TO 63
FOR s=0 TO 3
adr=s_offs+272+512*i+8*z+2*s
s_note=PEEK(adr)
voice=PEEK(adr+1)
IF s_note>0
octave=s_note DIV 16
dnote=s_note MOD 16
pos=12*(octave-1)+dnote
adr=d_offs+600+1024*i+16*z+4*s
DPOKE adr,t%(pos)
POKE adr+2,voice
ENDIF
NEXT s
NEXT z
NEXT i
l=600+1024*maxpat
FILESELECT "\*.ami","",n$
IF n$<>""
BSAVE n$,d_offs,l
ENDIF
ENDIF
RETURN
'
PROCEDURE tab_init
t=&H358
q=2^(1/12)
FOR i=0 TO 35
t%(i)=t
t=t/q
NEXT i
RETURN